/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.search;

import com.aptech.entity.Roles;
import com.aptech.session.RolesFacadeLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author DucMinh
 */
@ManagedBean
@RequestScoped
public class SearchRoleBeen {
    @EJB
    private RolesFacadeLocal rolesFacade;

    /** Creates a new instance of SearchRoleBeen */
    public SearchRoleBeen() {
        
    }
    private String field;
    private Object value;
    private List<Roles> roles;
    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public List<Roles> getRoles() {
        return roles;
    }

    public void setRoles(List<Roles> roles) {
        this.roles = roles;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public String searchRole(){
        roles= rolesFacade.searchroles(field, value);
        return "ResultSearchRoles";
    }        
}
